<?php
/**
 * Created by PhpStorm.
 * User: rocky
 * Date: 2019-07-14
 * Time: 01:24
 */

namespace app\shop\resource;

use app\common\model\ArticleCollect;
use app\common\resource\BaseResource;
use app\common\tools\Files;

class OrderResoure extends BaseResource
{
    public function toArray($data)
    {
        return [
            'id' => $data['id'],
            'order_no' => $data['order_no'],
            'title' => $data['title'],
            'name' => $data['store']['name'],
            'goods_price' => $data['goods_price'],
            'subscribe_time' => $data['subscribe_time'],
            'pay_price' => $data['pay_price'],
            'total_price' => $data['total_price'],
            'status' => $data['status'],
            'pay_time' => $data['pay_time'],
            'pay_type' => $data['pay_type'],
            'desc' => $data['desc'],
            'is_discount' => $data['is_discount'],
            'discount' => $data['discount'],
            'cancel_time'=>date('Y-m-d H:i:s',  strtotime($data['create_at']) + sysconf('order_cancel_time') * 3600),
            'confim_time' => date('Y-m-d H:i:s',  strtotime($data['express']['create_at']) + sysconf('order_confirm_time') * 3600 * 24),
            'create_at' => $data['create_at'],
        ];
    }

}